The present invention relates to the process of encoding video data. More specifically, the present invention relates to an MPEG-2 compliant video encoder with special border processing.
The function of an MPEG-2 compliant video encoder is to receive a digital video signal from a video source, such as a video camera, and to utilize a compression algorithm to generate an MPEG-2 compliant bit stream from an input sequence of frames. (See ISO/IEC 13818-2).
An MPEG-2 bit stream is made up of various layers of syntax, which include a Group of Pictures (GOP) layer and a macroblock and block layer, among others. A GOP is a set of frames which starts with an I-frame, and includes a certain number of P and B frames. Each frame is divided into macroblocks. Illustratively, a macroblock comprises four luminance blocks and two chrominance blocks. Each block is 8xc3x978 pixels.
An MPEG-2 video encoder will encode an I-frame, for example, in the following manner. Each 8xc3x978 block of pixels in a macroblock undergoes a discrete cosine transform (DCT) to form an 8xc3x978 array of transform coefficients. These transform coefficients are then quantized and scanned (e.g., using zig-zag scanning) to form a sequence of DCT coefficients. The DCT coefficients are then encoded using a variable length code.
A simplified block diagram of an MPEG-2 video encoder 100 is shown in FIG. 1. (For simplicity, many components of a conventional MPEG encoder have been omitted from FIG. 1). A motion estimator 110 receives current frame macroblocks (uncompressed video) from a video source, and also receives encoded reference frames from a reference frame memory 120. Motion estimator 110 then determines motion vectors, which describe the translation of macroblocks in a current frame relative to previously encoded reference frames. The motion vectors are used to xe2x80x9cmotion compensatexe2x80x9d each macroblock. That is, a predicted macroblock is formed by combining the reference frames with the motion vectors in a motion compensator 130. The predicted macroblock is then subtracted from the current macroblock to reduce the information in the macroblock. This motion compensated macroblock then undergoes a DCT transform in a DCT processor 140, and the resultant DCT coefficients are then quantized in a quantization processor 150. Finally, the quantized DCT coefficients and the motion vectors are encoded by a variable length encoder 160, and are outputted as a compressed bit stream.
A digital video signal consists of both active and inactive regions. The active region contains the actual picture. The inactive region above the active region is referred to as the vertical blank, and the inactive regions to the left and right of the active region are referred to as the horizontal blanks.
In some applications, parts of the inactive region are used to carry non-video data, such as xe2x80x98closed captionxe2x80x99. Typically, however, most of the inactive region is simply black.
A conventional video encoder will encode a region that includes not only most or all of the active pixels, but also some of the inactive pixels. These inactive pixels are typically encoded in order to encompass an integer multiple of macroblocks. This situation is illustrated in FIG. 2.
Normally, when an encoded video signal is decoded and displayed, not all of the decoded pixels are visible. This situation is illustrated in FIG. 3. Clearly, the process of encoding video which is not visible is an inefficient xe2x80x9cwastexe2x80x9d of bits. Accordingly, it is an object of the present invention to improve the efficiency of the encoding process by reducing or eliminating such bit waste.
It is a further object of the present invention to reduce or eliminate the wasted bits in compliance with the MPEG-2 standard.
These and other objects of the present invention are achieved by the present invention. In accordance with an illustrative embodiment of the present invention, an apparatus for efficiently compressing a digital video signal includes an edge processor and a video encoder. The edge processor receives the digital video signal and processes the edges of the video signal before applying it to the video encoder. That is, the edge processor may change at least one edge of the digital video signal to a solid color, preferably black. Alternately, the edge processor may blur at least one edge of the digital video signal. In a third variation, the edge processor may copy at least one pixel column of the digital video signal to a left edge or a right edge of the signal, or may copy at least one pixel row of the digital video signal to a top edge or a bottom edge of the signal.
The edge processed signal is then fed into the video encoder, which compresses the signal by conventional means. The compressed output bit stream is compatible with the MPEG-2 standard.
An illustrative embodiment of the present invention is more fully described below in conjunction with the following drawings.